10 HOME
20 PRINT CHR$(4);"PR#3"
22 HOME
23 DIM B(20,80)

24 DIM C(1600)

26 X1=10:Y1=42:X9=10:Y9=40:V8=10:V9=38:BB=0:LL=0:O1=0:C6=0:G1=0:MA=0:I9=1:CC=0:S1=0:H2=0:AM=1

27 FOR I=1 TO 8:M(I)=I:NEXT I

30 ONERR GOTO 31

31 INVERSE:VTAB 1:HTAB 26:PRINT"SNAKEBYTE & MAZE GAME":VTAB 23:HTAB 1:PRINT"                                                                               ":VTAB 23:HTAB 1:INPUT"INPUT A NUMBER BETWEEN 1 TO 999 : ";RDS:NORMAL
32 IF RDS<1 OR RDS>999 THEN 31

33 ONERR GOTO 34

34 HOME:INVERSE:VTAB 23:HTAB 1:PRINT" PLEASE INSERT A DATA DISK IN SLOT 6 DRIVE 2,THEN PRESS <SPC> TO BE CONTINUE. ":VTAB 23:HTAB 79:GET G$:VTAB 23:HTAB 79:PRINT G$:NORMAL

35 IF G$<>" " THEN 34

36 NORMAL:D2=1:GOSUB 15800

39 NORMAL:HOME:ONERR GOTO 22200

44 VTAB 10:HTAB 40:PRINT " "
45 REM VTAB 10:HTAB 40:PRINT "M"
50 INVERSE:VTAB 10:HTAB 42:PRINT "$":NORMAL
52 VTAB 20:HTAB 6:PRINT"Y":VTAB 20:HTAB 10:PRINT"I":VTAB 20:HTAB 15:PRINT"       ":VTAB 20:HTAB 25:PRINT"S - SAVE MAZE":VTAB 20:HTAB 66:PRINT"DOLLAR :    0"
54 VTAB 21 :HTAB 5:PRINT"G H":VTAB 21:HTAB 9:PRINT"J K":VTAB 21:HTAB 15:PRINT"F - GAME":VTAB 21:HTAB 25:PRINT"L - LOAD MAZE":VTAB 21:HTAB 42:PRINT"X - CATALOG":VTAB 21:HTAB 55:PRINT"        ":VTAB 21:HTAB 66:PRINT"  STEP :    0"
56 VTAB 22 :HTAB 6:PRINT"B":VTAB 22:HTAB 10:PRINT"M":VTAB 22:HTAB 15:PRINT"Q - QUIT":VTAB 22:HTAB 25:PRINT"C - CLEAR SCN":VTAB 22:HTAB 42:PRINT"T - SET MOUSE":VTAB 22:HTAB 66:PRINT"RESTEP :    0"

58 INVERSE:VTAB 23:HTAB 1:PRINT"                                                                               ":NORMAL

59 GOSUB 1200

60 REM NO=0:R1=0

61 REM INVERSE:VTAB 23:HTAB 50:PRINT"COMMON MODE     ":NORMAL

62 REM IF V8=10 AND V9=38 AND G1=0 THEN 64

63 REM IF G1>0 THEN INVERSE:VTAB 23:HTAB 50:PRINT"TARGET MODE     ":NORMAL:VTAB V8:HTAB V9:PRINT"T"


64 REM IF MA=1 THEN NORMAL:VTAB 23:HTAB 45:PRINT"SET"
65 REM IF MA=0 THEN NORMAL:VTAB 23:HTAB 45:PRINT"RND"

66 INVERSE:VTAB X1:HTAB Y1:PRINT"$":VTAB 23:HTAB 1:PRINT"COMMAND :                                   ":VTAB 23:HTAB 11:GET A$:GOSUB 60000:VTAB 23:HTAB 11:PRINT A$:NORMAL

72 IF A$="Q" THEN 9000

74 IF A$=CHR$(25) THEN X2=X1-1:Y2=Y1:GOSUB 1000:GOSUB 29000:X1=X2:Y1=Y2
75 IF A$=CHR$(7) THEN X2=X1:Y2=Y1-1:GOSUB 1000:GOSUB 29000:X1=X2:Y1=Y2
76 IF A$=CHR$(8) THEN X2=X1:Y2=Y1+1:GOSUB 1000:GOSUB 29000:X1=X2:Y1=Y2
77 IF A$=CHR$(2) THEN X2=X1+1:Y2=Y1:GOSUB 1000:GOSUB 29000:X1=X2:Y1=Y2

78 IF A$="I" THEN X2=X1-1:Y2=Y1:GOSUB 1000:INVERSE:VTAB X2:HTAB Y2:PRINT"$":GOSUB 50000:NORMAL:VTAB X1:HTAB Y1:PRINT"$":GOSUB 1100:B(X1,Y1)=1:GOSUB 29500:X1=X2:Y1=Y2
80 IF A$="J" THEN X2=X1:Y2=Y1-1:GOSUB 1000:INVERSE:VTAB X2:HTAB Y2:PRINT"$":GOSUB 50000:NORMAL:VTAB X1:HTAB Y1:PRINT"$":GOSUB 1100:B(X1,Y1)=1:GOSUB 29500:X1=X2:Y1=Y2
90 IF A$="K" THEN X2=X1:Y2=Y1+1:GOSUB 1000:INVERSE:VTAB X2:HTAB Y2:PRINT"$":GOSUB 50000:NORMAL:VTAB X1:HTAB Y1:PRINT"$":GOSUB 1100:B(X1,Y1)=1:GOSUB 29500:X1=X2:Y1=Y2
95 IF A$="M" THEN X2=X1+1:Y2=Y1:GOSUB 1000:INVERSE:VTAB X2:HTAB Y2:PRINT"$":GOSUB 50000:NORMAL:VTAB X1:HTAB Y1:PRINT"$":GOSUB 1100:B(X1,Y1)=1:GOSUB 29500:X1=X2:Y1=Y2

100 IF A$="Y" THEN X2=X1-1:Y2=Y1:GOSUB 1000:INVERSE:VTAB X2:HTAB Y2:PRINT"$":GOSUB 50000:NORMAL:VTAB X1:HTAB Y1:PRINT" ":GOSUB 1150:B(X1,Y1)=0:GOSUB 29500:X1=X2:Y1=Y2
110 IF A$="G" THEN X2=X1:Y2=Y1-1:GOSUB 1000:INVERSE:VTAB X2:HTAB Y2:PRINT"$":GOSUB 50000:NORMAL:VTAB X1:HTAB Y1:PRINT" ":GOSUB 1150:B(X1,Y1)=0:GOSUB 29500:X1=X2:Y1=Y2
120 IF A$="H" THEN X2=X1:Y2=Y1+1:GOSUB 1000:INVERSE:VTAB X2:HTAB Y2:PRINT"$":GOSUB 50000:NORMAL:VTAB X1:HTAB Y1:PRINT" ":GOSUB 1150:B(X1,Y1)=0:GOSUB 29500:X1=X2:Y1=Y2
130 IF A$="B" THEN X2=X1+1:Y2=Y1:GOSUB 1000:INVERSE:VTAB X2:HTAB Y2:PRINT"$":GOSUB 50000:NORMAL:VTAB X1:HTAB Y1:PRINT" ":GOSUB 1150:B(X1,Y1)=0:GOSUB 29500:X1=X2:Y1=Y2

136 IF A$="T" THEN 10000


160 IF A$="F" THEN 2000

170 IF A$="S" THEN 15000
180 IF A$="L" THEN 15100
182 IF A$="C" THEN 15500
184 IF A$="X" THEN 15800


191 IF A$=CHR$(6) THEN 33000

194 IF A$=CHR$(9) THEN 55000

198 IF A$=CHR$(19) THEN 54000


200 GOTO 60

 

650 INVERSE:VTAB 23:HTAB 1:PRINT"              WAITING                       ":NORMAL
660 FOR I=0 TO 20
670 FOR J=0 TO 80
680 IF (B(I,J)<>1 AND B(I,J)<>3) THEN B(I,J)=0
690 NEXT J
700 NEXT I
705 INVERSE:VTAB 23:HTAB 15:PRINT"        ":NORMAL
710 GOTO 60
 

900 H2=H2+1:N1=22:N2=78
902 IF H2>9 THEN N2=N2-1
910 IF H2>99 THEN N2=N2-1
920 IF H2>999 THEN N2=N2-1
922 IF H2>9999 THEN N2=N2-1
930 VTAB 22:HTAB 74:PRINT"     ":VTAB N1:HTAB N2: PRINT H2
940 RETURN


1000 IF X2<1 THEN X2=19
1010 IF X2>19 THEN X2=1
1020 IF Y2<1 THEN Y2=79
1030 IF Y2>79 THEN Y2=1

1040 RETURN

1100 IF B(X1,Y1)=0 OR B(X1,Y1)=3 THEN BB=BB+1
1110 RETURN 

1150 IF B(X1,Y1)=1 THEN BB=BB-1
1160 RETURN

1200 IF BB<0 THEN BB=0
1210 IF BB<10 AND BB>-1 THEN NN1=78
1220 IF BB<100 AND BB>9 THEN NN1=77
1230 IF BB<1000 AND BB>99 THEN NN1=76
1240 IF BB<10000 AND BB>999 THEN NN1=75
1242 IF BB<100000 AND BB>9999 THEN NN1=74
1250 VTAB 20:HTAB 74:PRINT"     "
1260 VTAB 20:HTAB NN1:PRINT BB
1270 RETURN


2000 INVERSE:VTAB 23:HTAB 1:PRINT"COMMAND :                                                                     ":VTAB 23:HTAB 50:PRINT"MAZE GAME  ":VTAB 23:HTAB 11:GET A$:GOSUB 60000:VTAB 23:HTAB 11:PRINT A$:NORMAL

2010 IF A$="S" THEN INVERSE:VTAB 23:HTAB 50:PRINT"SNAKEBYTE":NORMAL:GOTO 3000

2020 IF A$=CHR$(43) THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 60

2030 GOTO 2000


3000 FOR I=1 TO 19:VTAB I:HTAB 1:PRINT"$":B(I,1)=1:VTAB I:HTAB 79:PRINT"$":B(I,79)=1:NEXT I
3002 FOR J=1 TO 79:VTAB 1:HTAB J:PRINT"$":B(1,J)=1:VTAB 19:HTAB J:PRINT"$":B(19,J)=1:NEXT J

3004 GOSUB 29500

3008 XS=19:YS=40:XR=XS:YR=YS:INVERSE:VTAB XS:HTAB YS:PRINT"S":NORMAL

3010 INVERSE:VTAB 23:HTAB 11:GET A$:GOSUB 60000:VTAB 23:HTAB 11:PRINT A$:NORMAL

3020 IF A$="K" THEN 3100
3030 IF A$="J" THEN 3200

3040 IF A$="G" THEN 3300

3050 IF A$=CHR$(43) THEN GOSUB 4200:INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 60


3060 GOTO 3010

3100 REM 

3101 IF XS=19 THEN YS=YS+1:GOTO 3110
3102 IF XS=1 THEN YS=YS-1:GOTO 3110
3104 IF YS=79 THEN XS=XS-1:GOTO 3110
3106 IF YS=1 THEN XS=XS+1

3110 IF YS>79 THEN YS=79:XS=XS-1
3114 IF XS<1 THEN XS=1:YS=YS-1 
3116 IF YS<1 THEN YS=1:XS=XS+1
3118 IF XS>19 THEN XS=19:YS=YS+1

3120 INVERSE:VTAB XS:HTAB YS:PRINT"S":NORMAL

3122 IF B(XR,YR)=1 THEN VTAB XR:HTAB YR:PRINT"$":XR=XS:YR=YS
3124 IF B(XR,YR)=0 THEN VTAB XR:HTAB YR:PRINT" ":XR=XS:YR=YS


3130 GOTO 3010



3200 REM 

3201 IF XS=19 THEN YS=YS-1:GOTO 3210
3202 IF XS=1 THEN YS=YS+1:GOTO 3210
3204 IF YS=79 THEN XS=XS+1:GOTO 3210
3206 IF YS=1 THEN XS=XS-1

3210 IF YS>79 THEN YS=79:XS=XS+1
3214 IF XS<1 THEN XS=1:YS=YS+1 
3216 IF YS<1 THEN YS=1:XS=XS-1
3218 IF XS>19 THEN XS=19:YS=YS-1

3220 INVERSE:VTAB XS:HTAB YS:PRINT"S":NORMAL
3222 IF B(XR,YR)=1 THEN VTAB XR:HTAB YR:PRINT"$":XR=XS:YR=YS
3224 IF B(XR,YR)=0 THEN VTAB XR:HTAB YR:PRINT" ":XR=XS:YR=YS

3230 GOTO 3010


3300 REM IF (XS=1 AND YS=1) OR (XS=19 AND YS=1) OR (XS=19 AND YS=79) OR (XS=1 AND YS=79) THEN 3010

3302 VTAB 21:HTAB 74:PRINT"    0":VTAB 22:HTAB 74:PRINT"    0"


3302 IF XS=19 AND YS=1 THEN KA=2:GOTO 3400
3303 IF XS=1 AND YS=1 THEN KA=4:GOTO 3400
3304 IF XS=1 AND YS=79 THEN KA=6:GOTO 3400
3305 IF XS=19 AND YS=79 THEN KA=8:GOTO 3400 


3306 IF XS=19 THEN KA=1:GOTO 3400
3310 IF XS=1  THEN KA=5:GOTO 3400
3320 IF YS=1  THEN KA=3:GOTO 3400
3330 IF YS=79 THEN KA=7 


3400 I7=1:LM=12:SP=0:DD=0:FOR Q=0 TO 1600:C(Q)=0:NEXT Q

3401 IF SP>300 THEN SP=0:LM=LM+3 

3402 IF I7>LM THEN I7=LM:GOSUB 3600 


3403 IF PEEK(-16384)=202 THEN KA=KA-1:GOSUB 3800:POKE -16384+16,0
3404 IF PEEK(-16384)=203 THEN KA=KA+1:GOSUB 3800:POKE -16384+16,0


3405 IF KA=1 THEN FOR J=1 TO 2000:NEXT J:XS=XS-1:GOSUB 4300:C(I7)=100*XS+YS:I7=I7+1
3406 IF KA=5 THEN FOR J=1 TO 2000:NEXT J:XS=XS+1:GOSUB 4300:C(I7)=100*XS+YS:I7=I7+1
3407 IF KA=3 THEN FOR J=1 TO 1500:NEXT J:YS=YS+1:GOSUB 4300:C(I7)=100*XS+YS:I7=I7+1
3408 IF KA=7 THEN FOR J=1 TO 1500:NEXT J:YS=YS-1:GOSUB 4300:C(I7)=100*XS+YS:I7=I7+1


3415 IF KA=2 THEN FOR J=1 TO 3000:NEXT J:XS=XS-1:YS=YS+1:GOSUB 4300:C(I7)=100*XS+YS:I7=I7+1
3416 IF KA=6 THEN FOR J=1 TO 3000:NEXT J:XS=XS+1:YS=YS-1:GOSUB 4300:C(I7)=100*XS+YS:I7=I7+1
3417 IF KA=4 THEN FOR J=1 TO 3000:NEXT J:XS=XS+1:YS=YS+1:GOSUB 4300:C(I7)=100*XS+YS:I7=I7+1
3418 IF KA=8 THEN FOR J=1 TO 3000:NEXT J:XS=XS-1:YS=YS-1:GOSUB 4300:C(I7)=100*XS+YS:I7=I7+1



3419 GOTO 3700


3420 XT=INT(C(1)/100):YT=C(1)-100*(INT(C(1)/100))

3421 INVERSE

3422 VTAB INT(C(I7-1)/100):HTAB C(I7-1)-100*(INT(C(I7-1)/100)):PRINT"S"

3423 IF I7=2 AND B(XR,YR)=1 THEN NORMAL:VTAB XR:HTAB YR:PRINT"$":GOTO 3402

3424 IF I7=2 AND B(XR,YR)=0 THEN NORMAL:VTAB XR:HTAB YR:PRINT" ":GOTO 3402


3425 FOR I=I7-2 TO 1 STEP-1
3426 VTAB INT(C(I)/100):HTAB C(I)-100*(INT(C(I)/100)):PRINT" "
3427 NEXT I

3460 IF B(XS,YS)=3 THEN B(XS,YS)=0:GOSUB 29500:I9=TS+1

3461 IF TS=0 THEN 4000

3462 GOSUB 3900:IF B(XS,YS)=1 OR DD=1 THEN DD=0:NORMAL:GOTO 4000 

3529 SP=SP+1:INVERSE:VTAB 20:HTAB 40:PRINT"TIMER":NORMAL:VTAB 20:HTAB 46:PRINT"       ":VTAB 20:HTAB 46:PRINT 301-SP      

3530 B(XS,YS)=2:GOSUB 27000

3531 FOR L=1 TO 1000:NEXT L

3532 GOTO 3401



3600 NORMAL:VTAB XT:HTAB YT:PRINT" "

3602 FOR M=1 TO I7
3610 C(M)=C(M+1)
3620 NEXT M

3630 RETURN



3700 IF XS>18 OR XS<2 OR YS>78 OR YS<2 THEN 4000
3710 GOTO 3420



3800 IF KA>8 THEN KA=1
3810 IF KA<1 THEN KA=8

3820 RETURN


3900 FOR N=1 TO I7-2
3910 IF INT(C(N)/100)=XS AND C(N)-100*INT(C(N)/100)=YS THEN DD=1
3920 NEXT N

3960 RETURN


4000 FOR U=1 TO I7-2
4010 NORMAL:VTAB INT(C(U)/100):HTAB C(U)-100*INT(C(U)/100):PRINT" "
4020 NEXT U

4030 IF B(XS,YS)=1 THEN VTAB XS:HTAB YS:PRINT"$"
4040 IF B(XS,YS)=0 THEN VTAB XS:HTAB YS:PRINT" " 

4042 GOSUB 4200:INVERSE:VTAB 23:HTAB 50:PRINT"                             ":NORMAL

4050 FOR I=0 TO 1600:C(I)=0:NEXT I
4052 S1=0:H2=0:GOSUB 29800

4055 REM FOR J=1 TO 10000:NEXT J

4060 GOTO 60


4200 FOR I=1 TO 19:VTAB I:HTAB 1:PRINT" ":B(I,1)=0:VTAB I:HTAB 79:PRINT" ":B(I,79)=0:NEXT I
4202 FOR J=1 TO 79:VTAB 1:HTAB J:PRINT" ":B(1,J)=0:VTAB 19:HTAB J:PRINT" ":B(19,J)=0:NEXT J

4204 GOSUB 29500

4206 RETURN

4300 IF B(XS,YS)=2 THEN GOSUB 900
4310 RETURN

 

9000 HOME:PRINT CHR$(4);"CATALOG"+",D1,S6":END



10000 TA=1:BT=BB:SS=0:X2=10:Y2=42:CC=CC+1

10001 REM  

10002 IF LL=1 AND RU=0 THEN GOSUB 56000:GOTO 10006  

10004 IF RU=1 THEN RU=0:GOSUB 56000:GOTO 10006

10005 BB=0:TS=0:GOSUB 56000:GOSUB 15830:GOSUB 1200:GOSUB 29200

10006 INVERSE:VTAB X1:HTAB Y1:PRINT"$"
10008 VTAB 23:HTAB 1:PRINT"COMMAND :                                                                     ":VTAB 23:HTAB 50:PRINT"SET MOUSE       ":VTAB 23:HTAB 11:GET A$:GOSUB 60000:VTAB 23:HTAB 11:PRINT A$:NORMAL

11000 REM 

11016 IF A$=CHR$(25) THEN X2=X1-1:Y2=Y1:GOSUB 1000:GOSUB 29000:GOSUB 29200:GOSUB 29300:X1=X2:Y1=Y2
11017 IF A$=CHR$(7) THEN X2=X1:Y2=Y1-1:GOSUB 1000:GOSUB 29000:GOSUB 29200:GOSUB 29300:X1=X2:Y1=Y2
11018 IF A$=CHR$(8) THEN X2=X1:Y2=Y1+1:GOSUB 1000:GOSUB 29000:GOSUB 29200:GOSUB 29300:X1=X2:Y1=Y2
11019 IF A$=CHR$(2) THEN X2=X1+1:Y2=Y1:GOSUB 1000:GOSUB 29000:GOSUB 29200:GOSUB 29300:X1=X2:Y1=Y2

11020 IF A$="I" THEN X2=X1-1:Y2=Y1:GOSUB 1000:GOSUB 29400:GOSUB 29200:GOSUB 29300:GOSUB 57000:X1=X2:Y1=Y2
11021 IF A$="J" THEN X2=X1:Y2=Y1-1:GOSUB 1000:GOSUB 29400:GOSUB 29200:GOSUB 29300:GOSUB 57000:X1=X2:Y1=Y2
11022 IF A$="K" THEN X2=X1:Y2=Y1+1:GOSUB 1000:GOSUB 29400:GOSUB 29200:GOSUB 29300:GOSUB 57000:X1=X2:Y1=Y2
11023 IF A$="M" THEN X2=X1+1:Y2=Y1:GOSUB 1000:GOSUB 29400:GOSUB 29200:GOSUB 29300:GOSUB 57000:X1=X2:Y1=Y2

11024 IF A$="Y" THEN X2=X1-1:Y2=Y1:GOSUB 1000:GOSUB 29000:GOSUB 11900:GOSUB 29200:GOSUB 29300:GOSUB 57000:X1=X2:Y1=Y2
11025 IF A$="G" THEN X2=X1:Y2=Y1-1:GOSUB 1000:GOSUB 29000:GOSUB 11900:GOSUB 29200:GOSUB 29300:GOSUB 57000:X1=X2:Y1=Y2
11026 IF A$="H" THEN X2=X1:Y2=Y1+1:GOSUB 1000:GOSUB 29000:GOSUB 11900:GOSUB 29200:GOSUB 29300:GOSUB 57000:X1=X2:Y1=Y2
11027 IF A$="B" THEN X2=X1+1:Y2=Y1:GOSUB 1000:GOSUB 29000:GOSUB 11900:GOSUB 29200:GOSUB 29300:GOSUB 57000:X1=X2:Y1=Y2

11028 IF I9>1001 THEN 11070
11030 IF A$="A" THEN XV=X1:YV=Y1:FOR I=AM TO AM+300:GOSUB 59000:GOSUB 29400:GOSUB 29200:GOSUB 29300:GOSUB 57000:NEXT I:X1=XV:Y1=YV:AM=AM+300


11070 IF A$=CHR$(43) THEN TA=0:GOSUB 12500:GOSUB 29500:INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 60


11100 GOTO 10006


11900 FOR L=1 TO I9-1
11910 IF 100*X1+Y1=C(L) THEN 12000
11920 NEXT L

11930 RETURN
 


12000 FOR K=L TO I9-1
12010 C(K)=C(K+1)
12020 NEXT K

12030 I9=I9-1

12040 RETURN


12500 IF I9=1 THEN RETURN
12502 FOR N=1 TO I9-1
12510 XN=INT(C(N)/100):YN=C(N)-100*XN
12520 B(XN,YN)=3
12530 NEXT N

12560 RETURN 


 


15000 INVERSE:VTAB 23:HTAB 1:PRINT"                                                 ":VTAB 23:HTAB 1:INPUT"FILENAME : ";F$:NORMAL

15005 INVERSE:VTAB 23:HTAB 50:PRINT"SAVING":NORMAL
15007 IF F$=CHR$(43) THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 60

15009 IF LEN(F$) > 24 THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 15000

15010 REM 

15012 PRINT CHR$(4);"OPEN";F$
15020 PRINT CHR$(4);"WRITE";F$ 
15030 FOR I=1 TO 19
15040 FOR J=1 TO 79

15042 IF B(I,J)=3 THEN PRINT 0:GOTO 15060

15050 PRINT B(I,J)
15060 NEXT J
15070 NEXT I
15080 PRINT CHR$(4);"CLOSE";F$

15081 PRINT CHR$(4);"OPEN";F$+".INDEX"
15082 PRINT CHR$(4);"WRITE";F$+".INDEX"
15083 PRINT X1:PRINT Y1:PRINT X9:PRINT Y9:PRINT V8:PRINT V9:PRINT G1:PRINT M(1):PRINT M(2):PRINT M(3):PRINT M(4):PRINT M(5):PRINT M(6):PRINT M(7):PRINT M(8):PRINT T$:PRINT MA
15084 PRINT CHR$(4);"CLOSE";F$+".INDEX"

15086 PRINT CHR$(4);"OPEN";F$+".BITMAP"
15088 PRINT CHR$(4);"WRITE";F$+".BITMAP" 
15090 FOR I=1 TO 19
15092 FOR J=1 TO 79
15093 PRINT B(I,J);
15094 NEXT J
15095 PRINT
15096 NEXT I
15097 PRINT CHR$(4);"CLOSE";F$+".BITMAP"

15098 INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL
15099 GOTO 60


15100 INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":VTAB 23:HTAB 1:INPUT"FILENAME : ";F$:NORMAL
15105 INVERSE:VTAB 23:HTAB 50:PRINT"LOADING":NORMAL
15106 IF F$=CHR$(43) THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 60

15108 REM 

15110 REM 
15120 PRINT CHR$(4);"READ";F$ 
15130 FOR I=1 TO 19
15140 FOR J=1 TO 79
15150 INPUT B(I,J)
15160 NEXT J
15170 NEXT I
15180 PRINT CHR$(4);"CLOSE";F$
15181 REM 
15182 PRINT CHR$(4);"READ";F$+".INDEX"
15183 INPUT X1:INPUT Y1:INPUT X9:INPUT Y9:INPUT V8:INPUT V9:INPUT G1:INPUT M(1):INPUT M(2):INPUT M(3):INPUT M(4):INPUT M(5):INPUT M(6):INPUT M(7):INPUT M(8):INPUT T$:INPUT MA
15184 PRINT CHR$(4);"CLOSE";F$+".INDEX"
15185 IF M(5)=0 THEN FOR I=1 TO 8:M(I)=I:NEXT I:T$="R  DR  D  DL  L  UL  U  UR "

15187 REM 
15188 REM GOSUB 55000
15189 REM 



15193 IF G1>0 THEN INVERSE:VTAB 23:HTAB 50:PRINT"TARGET MODE     ":NORMAL
15194 IF G1=0 THEN RN=1:GOSUB 41000


15196 NORMAL:VTAB 20:HTAB 44:PRINT"                "

15197 IF MA=1 THEN C6=0:NORMAL:VTAB 21:HTAB 15:PRINT"        "

15198 IF MA=0 THEN C6=C6+1:FOR I=1 TO 8:S(I)=M(I):NEXT I:VTAB 21:HTAB 15:PRINT"E - ECHO"

15199 LL=1:RU=0:GOSUB 1200:GOTO 15820

15200 BB=0:VTAB 20:HTAB 74:PRINT"     ":VTAB 21:HTAB 74:PRINT"    0":VTAB 22:HTAB 74:PRINT"    0" 
15202 FOR I=1 TO 19
15210 FOR J=1 TO 79
15220 IF B(I,J)=1 THEN VTAB I:HTAB J:PRINT"$"
15222 IF B(I,J)=3 THEN INVERSE:VTAB I:HTAB J:PRINT"M":NORMAL
15224 IF B(I,J)=0 THEN VTAB I:HTAB J:PRINT" "
15230 NEXT J
15240 NEXT I

15242 GOSUB 29500

15250 RETURN

15500 NORMAL:VTAB 20:HTAB 40:PRINT"                          ":INVERSE:VTAB 23:HTAB 66:PRINT"             ":NORMAL

15502 FOR I=1 TO 19
15510 FOR J=1 TO 79
15520 VTAB I:HTAB J:PRINT" "
15530 NEXT J
15540 NEXT I

15542 FOR I=0 TO 20
15543 FOR J=0 TO 80
15544 B(I,J)=0
15545 NEXT J
15546 NEXT I

15548 BB=0
15549 VTAB 20:HTAB 74:PRINT"    0":VTAB 21:HTAB 74:PRINT"    0":VTAB 22:HTAB 74:PRINT"    0"

15550 FOR I=0 TO 1600:C(I)=0:NEXT I

15560 GOTO 60


15800 HOME
15802 PRINT CHR$(4);"CATALOG"+",D2,S6"
15810 PRINT:PRINT"<PRESS ANY KEY TO BE CONTINUE>":NORMAL:GET CT$:PRINT CT$
15820 HOME:BB=0:TS=0
15830 FOR I=1 TO 19
15840 FOR J=1 TO 79
15850 IF B(I,J)=1 THEN VTAB I:HTAB J:PRINT"$":BB=BB+1
15852 IF B(I,J)=3 THEN INVERSE:VTAB I:HTAB J:PRINT"M":NORMAL:TS=TS+1
15860 NEXT J
15870 NEXT I

15871 IF D2=1 THEN D2=0:RETURN

15872 GOSUB 29550

15880 IF TA=1 THEN RETURN

15990 GOTO 52


22200 INVERSE:VTAB 23:HTAB 50:PRINT"ERROR OCCURED":NORMAL:FOR I=1 TO 50000:NEXT I:GOTO 60
 

26000 NORMAL
26002 FOR I=1 TO 19
26010 FOR J=1 TO 79
26020 IF (B(I,J)<>1 AND B(I,J)<>3) THEN VTAB I:HTAB J:PRINT" "
26030 NEXT J
26040 NEXT I

26042 FOR I=0 TO 1600:C(I)=0:NEXT I

26050 RETURN

27000 S1=S1+1:N1=21:N2=78
27010 IF S1>9 THEN N2=N2-1
27020 IF S1>99 THEN N2=N2-1
27030 IF S1>999 THEN N2=N2-1
27032 IF S1>9999 THEN N2=N2-1
27040 VTAB 21:HTAB 74:PRINT"     ":VTAB N1:HTAB N2: PRINT S1
27050 RETURN

28000 IF R1>8 THEN RETURN
28010 INVERSE:VTAB 23:HTAB 66:PRINT"ROOT PASS : ";R1:NORMAL
28020 RETURN



29000 REM IF (X1=X9 AND Y1=Y9) OR (G1>0 AND X1=V8 AND Y1=V9) THEN 29040

29010 IF B(X1,Y1)=1 THEN NORMAL:VTAB X1:HTAB Y1:PRINT"$"
29020 IF B(X1,Y1)=0 THEN NORMAL:VTAB X1:HTAB Y1:PRINT" "
29022 IF B(X1,Y1)=3 AND TA=0 THEN INVERSE:VTAB X1:HTAB Y1:PRINT"M":NORMAL
29030 REM IF (X2=X9 AND Y2=Y9) OR (G1>0 AND X2=V8 AND Y2=V9) THEN 29050
29040 INVERSE:VTAB X2:HTAB Y2:PRINT"$":NORMAL
 

29050 RETURN

29200 FOR A=1 TO I9-1
29202 IF C(A)>100 AND C(A)<> 9999 THEN INVERSE:VTAB INT(C(A)/100):HTAB C(A)-100*INT(C(A)/100):PRINT"M":NORMAL
29204 NEXT A

29250 RETURN

 
29300 NORMAL:VTAB 20:HTAB 53:PRINT"             "                                                                         
29310 INVERSE:VTAB 20:HTAB 53:PRINT"MOUSE":NORMAL:VTAB 20:HTAB 59:PRINT I9-1:TR=1
29320 NORMAL

29330 RETURN


29350 NORMAL:VTAB 20:HTAB 53:PRINT"             "                                                                         
29352 INVERSE:VTAB 20:HTAB 53:PRINT"MOUSE":NORMAL:VTAB 20:HTAB 59:PRINT TS
29354 NORMAL

29360 RETURN


29400 FOR I=1 TO I9
29410 IF C(I)=100*X1+Y1 THEN 29430
29422 NEXT I
29424 C(I9)=100*X1+Y1
29426 I9=I9+1
29430 RETURN 


29500 TS=0:BB=0

29502 FOR I=1 TO 19
29510 FOR J=1 TO 79
29520 IF B(I,J)=3 THEN TS=TS+1
29522 IF B(I,J)=1 THEN BB=BB+1
29530 NEXT J
29540 NEXT I

29550 INVERSE:VTAB 20:HTAB 53:PRINT"MOUSE":NORMAL:VTAB 20:HTAB 59:PRINT"    ":VTAB 20:HTAB 59:PRINT TS
29556 GOSUB 1200

29560 RETURN

29800 FOR I=1 TO 19
29810 FOR J=1 TO 79
29820 IF B(I,J)=2 THEN B(I,J)=0
29830 NEXT J
29840 NEXT I

29860 RETURN



 

33000 INVERSE:VTAB 23:HTAB 1:PRINT"                                                                              ":VTAB 23:HTAB 50:PRINT"MAZE FIXING":VTAB 23:HTAB 1:INPUT"FILENAME : ";F$:NORMAL

33002 IF F$=CHR$(43) THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 60

33010 A9=10:B9=40:C8=10:D9=38:E1=0:FF=1

33012 N(1)=1:N(2)=2:N(3)=3:N(4)=4:N(5)=5:N(6)=6:N(7)=7:N(8)=8

33014 H$="R  DR  D  DL  L  UL  U  UR "

33016 REM 

33081 REM 
33082 PRINT CHR$(4);"READ";F$+".INDEX"
33083 INPUT T1:INPUT T2
33084 PRINT CHR$(4);"CLOSE";F$+".INDEX"


33181 PRINT CHR$(4);"OPEN";F$+".INDEX"
33182 PRINT CHR$(4);"WRITE";F$+".INDEX"
33183 PRINT T1:PRINT T2:PRINT A9:PRINT B9:PRINT C8:PRINT D9:PRINT E1:PRINT N(1):PRINT N(2):PRINT N(3):PRINT N(4):PRINT N(5):PRINT N(6):PRINT N(7):PRINT N(8):PRINT H$:PRINT FF
33184 PRINT CHR$(4);"CLOSE";F$+".INDEX"



33281 PRINT CHR$(4);"OPEN";F$+".MOUSE"
33282 PRINT CHR$(4);"WRITE";F$+".MOUSE"

33283 FOR I=1 TO 19
33285 FOR J=1 TO 79
33287 PRINT 0
33289 NEXT J
33290 NEXT I 

33294 PRINT CHR$(4);"CLOSE";F$+".MOUSE"


33381 PRINT CHR$(4);"OPEN";F$+".MOUSE"+".INDEX"
33382 PRINT CHR$(4);"WRITE";F$+".MOUSE"+".INDEX"
33383 PRINT 1
33384 PRINT CHR$(4);"CLOSE";F$+".MOUSE"+".INDEX"


33886 INVERSE:VTAB 23:HTAB 50:PRINT"           ":VTAB 23:HTAB 12:PRINT"                              ":NORMAL

33890 GOTO 60


 

40000 NORMAL:VTAB V8:HTAB V9:PRINT"T"

40002 FOR I=0 TO 80

40010 B(0,I)=1:B(20,I)=1
40020 NEXT I

40030 FOR J=0 TO 20
40040 B(J,0)=1:B(J,80)=1
40050 NEXT J


40090 RETURN

41000 IF RN=1 THEN 41006

41001 IF B(V8,V9)=1 THEN B(V8,V9)=0:BB=BB-1:GOSUB 1200 

41002 NORMAL:VTAB V8:HTAB V9:PRINT" ":G1=0:V8=10:V9=38

41006 INVERSE:VTAB 23:HTAB 50:PRINT"COMMON MODE     ":NORMAL

41008 FOR I=0 TO 80


41010 B(0,I)=0:B(20,I)=0
41020 NEXT I

41030 FOR J=0 TO 20
41040 B(J,0)=0:B(J,80)=0
41050 NEXT J
41060 IF RN=1 THEN RN=0:RETURN

41090 GOTO 64
 
 

 

 


50000 IF B(X1,Y1)=3 THEN C(I9)=0:I9=I9-1:NORMAL:VTAB 20:HTAB 59:PRINT"        ":VTAB 20:HTAB 59:PRINT I9
50010 RETURN

51000 IF B(X1,Y1)=1 THEN BB=BB-1:GOSUB 1200
51010 RETURN
 

 

54000 INVERSE:VTAB 23:HTAB 1:PRINT"                                                 ":VTAB 23:HTAB 1:INPUT"FILENAME : ";F$:NORMAL

54005 INVERSE:VTAB 23:HTAB 50:PRINT"SAVING":NORMAL
54007 IF F$=CHR$(43) THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 60

54009 IF LEN(F$) > 24 THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 54000


54010 PRINT CHR$(4);"OPEN";F$+".MOUSE"

54020 PRINT CHR$(4);"WRITE";F$+".MOUSE" 
54030 FOR I=1 TO 19
54040 FOR J=1 TO 79
54050 PRINT B(I,J)
54060 NEXT J
54070 NEXT I
54080 PRINT CHR$(4);"CLOSE";F$+".MOUSE"


54100 PRINT CHR$(4);"OPEN";F$+".MOUSE"+".INDEX"
54120 PRINT CHR$(4);"WRITE";F$+".MOUSE"+".INDEX" 
54150 PRINT I9 
54180 PRINT CHR$(4);"CLOSE";F$+".MOUSE"+".INDEX"

54190 GOTO 60

55000 INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":VTAB 23:HTAB 1:INPUT"FILENAME : ";F$:NORMAL
55005 INVERSE:VTAB 23:HTAB 50:PRINT"LOADING":NORMAL
55006 IF F$=CHR$(43) THEN INVERSE:VTAB 23:HTAB 12:PRINT"                                                                    ":NORMAL:GOTO 60


55020 PRINT CHR$(4);"READ";F$+".MOUSE" 
55030 FOR I=1 TO 19
55040 FOR J=1 TO 79

55042 IF B(I,J)=3 THEN B(I,J)=0

55050 INPUT B(0,0)
55052 IF B(0,0)=3 THEN B(I,J)=3
55060 NEXT J
55070 NEXT I
55080 PRINT CHR$(4);"CLOSE";F$+".MOUSE"


55100 REM
55120 PRINT CHR$(4);"READ";F$+".MOUSE"+".INDEX" 
55150 INPUT I9 
55180 PRINT CHR$(4);"CLOSE";F$+".MOUSE"+".INDEX"

55190 GOTO 15193


56000 I9=1

56002 FOR I=1 TO 19
56010 FOR J=1 TO 79
56020 IF B(I,J)=3 THEN C(I9)=100*I+J:B(I,J)=0:I9=I9+1
56030 NEXT J
56040 NEXT I

56060 RETURN


57000 GOSUB 58000
57002 BB=BT-SS:GOSUB 1200
57020 RETURN


58000 SS=0
58002 FOR I=1 TO I9-1
58010 IF B(INT(C(I)/100),C(I)-100*INT(C(I)/100))=1 THEN SS=SS+1
58020 NEXT I

58060 RETURN

59000 RQ=RDS
59006 FOR L=1 TO RQ
59010 TE=RND(RQ)
59020 NEXT L

59040 RQ=TE

59060 X1=INT(RND(RQ)*17+2):Y1=INT(RND(RQ)*77+2)

59090 RETURN



60000 IF A$=CHR$(10) OR A$=CHR$(13) OR A$=CHR$(22) OR A$=CHR$(12) OR A$=CHR$(11) OR A$=CHR$(17) OR A$=CHR$(23) OR A$=CHR$(21) OR A$=CHR$(27) THEN A$=" "
60002 RETURN
    